package petstore.web.servlet.signup;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import petstore.web.servlet.signup.signupServlet;

public class signupForm extends HttpServlet {
    private String SIGNUP_PAGE="/WEB-INF/jsp/signupPage/signupPage.jsp";
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //String code=Integer.toString(1000+(int)(Math.random()*999));
        //HttpSession session = req.getSession();
        //session.setAttribute("signupCode",code);

        //请求转发，打开注册界面
        req.getRequestDispatcher(SIGNUP_PAGE).forward(req,resp);
    }
}
